package com.example.demo.web;

import com.example.demo.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author
 * 日志 web层
 */
@Api(tags = "日志测试")
@RestController
@RequestMapping("/log")
@Slf4j
public class LogController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/test")
    @ApiOperation(value = "测试日志打印")
    public void test(){
        log.info("测试日志打印");
    }

    @GetMapping("/testMulThread")
    @ApiOperation(value = "测试多线程日志打印")
    public void testMulThread() throws InterruptedException {
        log.info("测试多线程日志打印");
        orderService.insertOrder();
    }

}